import React from 'react';
import {Consumer} from "../context";
import A from "./A";
import B from "./B";

function Child(props) {
    return (
        <div>
            Child
            <Consumer>
                {
                    value=>{
                        return (
                            <div>
                                <p>{value.userName}</p>
                                <p>{value.age}</p>
                            </div>
                        )
                    }
                }

            </Consumer>
            <hr/>
            <A/>
            <hr/>
            <B/>
        </div>
    );
}

export default Child;